
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>作者详情</title>
    <!-- 引入自定义 CSS -->
    <link href="<%= request.getContextPath() %>/resources/custom.css" rel="stylesheet">
    <style>
        .details-container {
            margin-top: 20px;
            padding: 20px;
            background-color: #fff;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .detail-item {
            margin-bottom: 15px;
        }

        .edit-button {
            padding: 10px 20px;
            background-color: #28a745;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            text-decoration: none;
            margin-right: 10px;
        }

        .edit-button:hover {
            background-color: #218838;
        }

        .back-link {
            padding: 10px 20px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            text-decoration: none;
            margin-top: 20px;
            display: inline-block;
        }

        .back-link:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
<div class="container">
    <h1 class="title">作者详情</h1>
    <div class="details-container">
        <div class="detail-item">
            <strong>作者编号:</strong> ${author.author_id}
        </div>
        <div class="detail-item">
            <strong>作者姓名:</strong> ${author.author_name}
        </div>
        <div class="detail-item">
            <strong>作者国籍:</strong> ${author.author_nation}
        </div>


    </div>

    <h2 class="title">书籍列表</h2>
    <div class="table-container">
        <table class="table">
            <thead>
            <tr>
                <th>书名</th>
                <th>出版时间</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${author.booksList}" var="book">
                <tr>
                    <td>${book.book_name}</td>
                    <td>${book.book_year}</td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>

    <a href="authorServlet" class="back-link">返回作者列表</a>
</div>
</body>
</html>
